const complement = (value) => {
  return value < 10 ? `0${value}` : value.toString();
}

export const formateDateTime = (datetime) => {
  const year = datetime.getFullYear();
  const month = complement(datetime.getMonth() + 1);
  const day = complement(datetime.getDate());
  const hour = complement(datetime.getHours());
  const minute = complement(datetime.getMinutes());
  const second = complement(datetime.getSeconds());
  return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
}